Fix doc examples: cannot import name#14698
Conversation
…o the individual methods instead)
| return self.decoder(*args, **kwargs) | ||
|
|
||
|
|
||
| # Copied from transformers.models.bart.modeling_bart.BartForCausalLM with Bart->BigBirdPegasus, 'facebook/bart-large'->"google/bigbird-pegasus-large-arxiv" |
There was a problem hiding this comment.
can't keep copy here, because there is no BigBirdPegasusTokenizer
There was a problem hiding this comment.
could we try to keep the copy and change Bart->BigBirdPegasus to BartDecoderWrapper->BigBirdPegasusDecoderWrapper and BartForCausalLM->BigBirdPegasusForCausalLM? This way the tokenizer should stay the same :-)
There was a problem hiding this comment.
The following does the trick:
- BartDecoderWrapper->BigBirdPegasusDecoderWrapper
- BartForCausalLM->BigBirdPegasusForCausalLM
- BartPreTrainedModel->BigBirdPegasusPreTrainedModel
- BartTokenizer->PegasusTokenizer
- 'facebook/bart-large'->"google/bigbird-pegasus-large-arxiv"
|
Great catch - thanks a lot for fixing it! I think we should do the exact same thing for the speech models (UniSpeech, SEW, UniSpeechSAT) actually. Feel free to open a PR if you want - I'll put it on my ToDo list as well though |
|
So I have seen and |
Yeah there is no |
|
@ydshieh - if ok for you, I would like to merge this one now and then if you want we could open a new one for |
Sure, ok for me. |
What does this PR do?
In doc examples in some PT model files, there are
cannot import nameerror. This PR fixes this issue.Who can review?
@patrickvonplaten
Question:
@patrickvonplaten , in
modeling_unispeech.py, there are examples usingAnd in some docstring, there are
However, these can't be imported
Is there any reason to make these objects invisible to
transformers?